/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package servidor;

import Protocolo.*;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

        /**
 *
 * @author CUC103AF08
 */
public class Main {
  //  public static void main(String[] arg){
//    System.out.println("Iniciando visitas");
//        Contador c = null;
//        for(int i = 0; i < 100; i++){
////            Usuario u = new Usuario();
//            c = u.visitarSitio();
//        }
//        System.out.println("Cuenta total de usuarios: " + c.getCuenta());

 //       Log n= new Log();
 //       n.guardarMensaje("hola XP ssss");
  //  }
    public static String leerConfig() throws FileNotFoundException{
    FileReader fr = new FileReader("config.txt");
    BufferedReader entrada = new BufferedReader(fr);
    String s="";
    try {
           s = entrada.readLine();
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    return s;
    }
    public static void main(String[] args){
        Servidor server;
        try {
            server = new Servidor(new ConexionServidor(Integer.valueOf(leerConfig())));
            server.start();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
}
    }

